import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Login from '../views/Login.vue'
import newsList from '../components/newsList.vue'
import releaseNews from '../components/releaseNews.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    redirect: '/newslist',
    children: [
      {
        path: '/newslist',
        name: '/newslistPage',
        component: newsList
      },
      {
        path: '/releasenews',
        name: '/releaseNewsPage',
        component: releaseNews
      }
    ]
  },
  {
    path: '/login',
    name: '/loginPage',
    component: Login
  }
]

const router = new VueRouter({
  routes
})

export default router
